class ModelCommentList {
  int? id;
  int? uid;
  String? nickname;
  String? avatar;
  int? productId;
  int? productScore;
  int? serviceScore;
  String? comment;
  List<String>? pics;
  String? addTime;
  String? addTimeText;
  int? replyCount;
  String? merchantReply;
  int? likeCount;

  ModelCommentList({
    this.id,
    this.uid,
    this.nickname,
    this.avatar,
    this.productId,
    this.productScore,
    this.serviceScore,
    this.comment,
    this.pics,
    this.addTime,
    this.addTimeText,
    this.replyCount,
    this.merchantReply,
    this.likeCount,
  });

  ModelCommentList.fromJson(Map<String, dynamic> json) {
    id = json['id']?.toInt();
    uid = json['uid']?.toInt();
    nickname = json['nickname']?.toString();
    avatar = json['avatar']?.toString();
    productId = json['product_id']?.toInt();
    productScore = json['product_score']?.toInt();
    serviceScore = json['service_score']?.toInt();
    comment = json['comment']?.toString();
    if (json['pics'] != null) {
      if (json['pics'] is String && (json['pics'] as String).isNotEmpty) {
        pics = (json['pics'] as String).split(',');
      } else if (json['pics'] is List) {
        pics = List<String>.from(json['pics']);
      } else {
        pics = [];
      }
    }
    addTime = json['add_time']?.toString();
    addTimeText = json['add_time_text']?.toString();
    replyCount = json['reply_count']?.toInt();
    merchantReply = json['merchant_reply']?.toString();
    likeCount = json['like_count']?.toInt();
  }

  Map<String, dynamic> toJson() {
    final data = <String, dynamic>{};
    data['id'] = id;
    data['uid'] = uid;
    data['nickname'] = nickname;
    data['avatar'] = avatar;
    data['product_id'] = productId;
    data['product_score'] = productScore;
    data['service_score'] = serviceScore;
    data['comment'] = comment;
    if (pics != null) {
      data['pics'] = pics!.join(',');
    }
    data['add_time'] = addTime;
    data['add_time_text'] = addTimeText;
    data['reply_count'] = replyCount;
    data['merchant_reply'] = merchantReply;
    data['like_count'] = likeCount;
    return data;
  }
}

